package com.example.design.prototype;

import java.util.Hashtable;

public class PrototypeManager {
	private Hashtable ht = new Hashtable();
	private static PrototypeManager pm = new PrototypeManager();//e汉模式
	
	 //为Hashtable增加公文对象   
    private  PrototypeManager(){
         ht.put("far",new  FAR());
         ht.put("srs",new  SRS());               
    }
	
	public void addOfficialDocument(String key, OfficialDocument od) {
		ht.put(key, od);
	}
	
	public OfficialDocument getOfficialDocument(String key) {
		return ((OfficialDocument)ht.get(key)).clone();
	}
	
	public static PrototypeManager getPrototypeManager() {
		return pm;
	}
}
